package com.yxy.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yxy.common.annotation.Log;
import com.yxy.common.core.controller.BaseController;;
import com.yxy.common.core.domain.AjaxResult;
import com.yxy.common.enums.BusinessType;
import com.yxy.system.domain.ReportTipLog;
import com.yxy.system.service.IReportTipLogService;
import com.yxy.common.utils.poi.ExcelUtil;
import com.yxy.common.core.page.TableDataInfo;

/**
 * 报告提示日志Controller
 * 
 * @author 402844673@qq.com
 * @date 2025-09-04
 */
@RestController
@RequestMapping("/system/fklog")
public class ReportTipLogController extends BaseController
{
    @Autowired
    private IReportTipLogService reportTipLogService;

    /**
     * 查询报告提示日志列表
     */
    @PreAuthorize("@ss.hasPermi('system:fklog:list')")
    @GetMapping("/list")
    public TableDataInfo list(ReportTipLog reportTipLog)
    {
        startPage();
        List<ReportTipLog> list = reportTipLogService.selectReportTipLogList(reportTipLog);
        return getDataTable(list);
    }

    /**
     * 导出报告提示日志列表
     */
    @PreAuthorize("@ss.hasPermi('system:fklog:export')")
    @Log(title = "报告提示日志", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ReportTipLog reportTipLog)
    {
        List<ReportTipLog> list = reportTipLogService.selectReportTipLogList(reportTipLog);
        ExcelUtil<ReportTipLog> util = new ExcelUtil<ReportTipLog>(ReportTipLog.class);
        util.exportExcel(response, list, "报告提示日志数据");
    }

    /**
     * 获取报告提示日志详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:fklog:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(reportTipLogService.selectReportTipLogById(id));
    }

    /**
     * 新增报告提示日志
     */
    @PreAuthorize("@ss.hasPermi('system:fklog:add')")
    @Log(title = "报告提示日志", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ReportTipLog reportTipLog)
    {
        return toAjax(reportTipLogService.insertReportTipLog(reportTipLog));
    }

    /**
     * 修改报告提示日志
     */
    @PreAuthorize("@ss.hasPermi('system:fklog:edit')")
    @Log(title = "报告提示日志", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ReportTipLog reportTipLog)
    {
        return toAjax(reportTipLogService.updateReportTipLog(reportTipLog));
    }

    /**
     * 删除报告提示日志
     */
    @PreAuthorize("@ss.hasPermi('system:fklog:remove')")
    @Log(title = "报告提示日志", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(reportTipLogService.deleteReportTipLogByIds(ids));
    }
}
